package function;

import java.util.HashMap;
import java.util.List;

import solver.Results;

import ccpv.Person;

import multiarray.MultiArray;

public abstract class ConflictFunction {
	protected HashMap<String,Double> constants = new HashMap<String,Double>();
	protected MultiArray<Person> population;
	protected double[][] theta;
	protected boolean isThetaSet = false;

	public abstract void setConstants(HashMap<String,Double> constants);
	public abstract void setPopulation(MultiArray<Person> population);
	public abstract void setCoalitions(List<List<int[]>> coalitions, float[][] beta);

	public abstract double[][] getDerivativeMatrix(double[][] theta);
	public abstract double[] getBounds(); 
	public abstract int getDimension();
	public abstract Results solve_and_update_agents();

	//Leo Needs?
	public abstract float[] getUtilities(List<List<int[]>> partition, float[][] beta);
	
// Deprecated:
//	public abstract void setAltruism(float[][] beta);
//	public abstract double payoff_expected(int i); 
//	public abstract void setTheta(double[][] theta);
//	public abstract void updateAgents(Results res);
//	public abstract double[] utility();
//	public abstract double utility(int i);	
//	public abstract double utility_bar(int i);
//	public abstract double[] utility_bar();
//  public abstract double utility_derivative(int i, int m, int n); /*Needed by solver*/
//  public abstract double utility_bar_derivative(int i, int m, int n);
	

	// Non-Abstract Methods
	
	
	public double[][] getTheta() {
		return solver.Utility.copyMatrix(theta);
	}
	
	
	public double getConstant(String name) {
		if (constants.containsKey(name)) {
			return constants.get(name);	
		} else {
			return 0;
		}
	}
}
